﻿var youjoin={};
youjoin.scale=(window.innerWidth/1920).toFixed(2);
youjoin.webscale=(window.innerWidth/1920).toFixed(2);
function browerType() {
    var sUserAgent = navigator.userAgent.toLowerCase();   //浏览器的用户代理设置为小写，再进行匹配
    var isIpad = sUserAgent.match(/ipad/i) == "ipad";   //或者利用indexOf方法来匹配
    var isIphoneOs = sUserAgent.match(/iphone/i) == "iphone";
    var isMidp = sUserAgent.match(/midp/i) == "midp";  //移动信息设备描述MIDP是一套Java应用编程接口，多适用于塞班系统
    var isUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";  //CVS标签
    var isUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var isAndroid = sUserAgent.match(/android/i) == "android";
    var isNokia= sUserAgent.match(/NOKIA/i) == "Nokia";
    var isCe = sUserAgent.match(/windows ce/i) == "windows ce";
    var isWM = sUserAgent.match(/windows mobil/i) == "windows mobil";
    if (isIpad || isIphoneOs || isMidp || isUc7 || isUc || isAndroid || isCe || isWM ||isNokia) {
        console.log('该设备为移动设备');
        youjoin.appscale=(window.innerWidth/1920).toFixed(2)
        youjoin.typedev="phone";
    } else {
    	youjoin.webscale=(window.innerWidth/1920).toFixed(2);
    	youjoin.typedev="web";
        console.log('该设备为PC设备');
    }
}
browerType();